//
//  DVPieCenterView.m
//  DVPieChart
//
//  Created by SmithDavid on 2018/2/27.
//  Copyright © 2018年 SmithDavid. All rights reserved.
//

#import "DVPieCenterView.h"

@interface DVPieCenterView ()

@property (strong, nonatomic) UIImageView *centerView;

@end



@implementation DVPieCenterView


- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor clearColor];
        UIImageView *centerView = [[UIImageView alloc] init];
        centerView.image = [[UIImage imageNamed:@"Fill8.png"] imageWithTintColor:[UIColor whiteColor]];
        [self addSubview:centerView];
        self.centerView = centerView;
        
        UILabel *nameLabel = [[UILabel alloc] init];
        nameLabel.textColor = kAppNormalTextColor;
        nameLabel.font = [UIFont lx_boldSystemFontOfSize:30];
        nameLabel.textAlignment = NSTextAlignmentCenter;
        self.nameLabel = nameLabel;
        [self addSubview:nameLabel];
    }
    
    return self;
}


- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    self.centerView.frame = CGRectMake(6, 6, self.frame.size.width - 6 * 2, self.frame.size.height - 6 * 2);
    self.nameLabel.frame = CGRectMake(self.centerView.frame.origin.x + 10, self.centerView.frame.origin.x + 30, self.centerView.frame.size.width - 20, self.centerView.frame.size.height - 60);
}


@end
